import { lazy } from "react";
import Home from '../path/home/Index'
import Login from '../path/login/Index'
import Error from '../path/404/Index'
import { createBrowserRouter, Navigate } from "react-router-dom";
let Order=lazy(()=>import('../path/order/Index'))
let User=lazy(()=>import('../path/user/Index'))
let Op=lazy(()=>import('../path/op/Index'))
export const menu_router=[
    {
        path:'/home/order',
        element:<Order></Order>,
        title:'都市'
    },
    {
        path:'/home/user',
        element:<User></User>,
        title:'玄幻'
    },
    {
        path:'/home/op',
        element:<Op></Op>,
        title:'奇幻'
    }
]
const routes=createBrowserRouter([
{
    path:'/',
    element:<Navigate to={'/home'}></Navigate>
},
{
    path:'/home',
    element:<Home></Home>,
    children:menu_router
},
{
    path:'/login',
    element:<Login></Login>
},
{
    path:'*',
    element:<Error></Error>
}
])
export default routes